home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / game / role / ldmud-3.2-bin.lha / mud / doc / LPC / inheritance < prev    next >
Text File  |  2001-04-06  |  758b  |  28 lines

  1. CONCEPT
  2.         inheritance
  3.  
  4. DESCRIPTION
  5.         An object can inherit all variables and functions from another
  6.         object. This is done with the declaration 'inherit "file";'.
  7.         This must come before any local variables or functions.
  8.  
  9.         An example, defining a monster:
  10.  
  11.         inherit "obj/monster";
  12.  
  13.         reset(arg) {
  14.             ::reset(arg);
  15.             set_name("troll");
  16.             set_level(9);
  17.             set_hp(100);
  18.             set_wc(12);
  19.             set_al(-60);
  20.             set_short("A troll");
  21.             set_long("It is a nasty troll that looks very aggressive.\n");
  22.             set_aggressive(1);
  23.         }
  24.  
  25. NOTE
  26.         Nowadays, inheritance has much more things to offer.
  27.         Description will follow eventually.
  28.